import { ListItem } from '../ListView/ListItem';
import { achieveProcess } from '../shop/gameData';

cc.Class({
    extends: ListItem,

    properties: {
       title: cc.Label,
       content: cc.Label,
       process: cc.Label,
    },

    start () {
        
    },
   initItem(data, index) {
       let count = achieveProcess[data.type];
       this.title.string = data.title;
       this.content.string = data.content;
        if(count >= data.all) {
            this.process.string  = `完成度：${formatMoney(data.all)}/${formatMoney(data.all)}`;
            this.process.node.color = new cc.color(52,54,144);
        }else {
            this.process.string  = `完成度：${formatMoney(count)}/${formatMoney(data.all)}`;
        }
   },
   onItemclick(data) {

   }

    // update (dt) {},
});
